<template>
	<view>
		<cuCustom :bgcolor="'#fff'" />
		<view class="p-4">
			<view class="span-20 balance d-flex flex-column a-start j-center">
				<image :src="`${getApp.globalData.baseImgUrl}/image/51@2x.png`" style="height: 270rpx;" mode=""></image>
				<view class="text-white font-md pl-5">账户当前余额</view>
				<view class="text-white font-lg pl-5"><text class="font-sm">￥</text>2140.70</view>
			</view>
		</view>
		<view>
			<scroll-view scroll-y="true" :style="'height:'+scorllHeight+ 'px;'" @scrolltolower="loadMore">
				<view class="shop-list p-4  pt-0">
					<view class="list-box pt-3 pb-3 pl-4 pr-4 mb-2 bg-white rounded-10" v-for="(item, index) in shopList" :key="index">
						<view class="list">
							<view class="list-center-info span-20 d-flex flex-column">
								<view class="d-flex flex-row span-20 j-sb font-md">
									<text class="mr-2  span-14">订单编号: {{item.goodNumber}}</text>
									<text class="flex-1 text-success">已完成</text>
								</view>
								<view class="d-flex flex-row span-20 j-sb text-light-muted font-md">
									<text class="mr-2">充值金额: <text class="main-text-color">￥25</text></text>
									<text>类型: <text>￥25</text></text>
								</view>
								<view class="d-flex flex-row span-20 j-sb text-light-muted font-md">
									<text class="mr-2 span-5">操作时间:</text>
									<text class="flex-1 text-right">2024-05-14 12:25:30</text>
								</view>
								<view class="d-flex flex-row span-20 j-sb text-light-muted font-md">
									<text class="mr-2  span-5">商家备注:</text>
									<text class="flex-1 text-right">盘锦[TEL：13840019372]陵西街道中心银行（陵北支行）11X</text>
								</view>
							</view>
						</view>
						<view class="list-btn mt-3 d-flex flex-row a-center j-end">
							<button class="mini-btn m-0 input-border-color border bg-none main-text-color" type="default"
								size="mini" @click.stop="toDelete(item.id)">删除</button>
							<!-- <button class="mini-btn m-0 mr-2 input-border-color border bg-none main-text-color"
								type="default" size="mini">同意退款</button>
							<button class="mini-btn m-0 main-bg-color text-white" type="default" size="mini"
								@click.stop="toDetail">查看详情</button> -->
						</view>
					</view>

				</view>
				<view class="d-flex a-center j-center text-light-muted font-md py-3">{{loadtext}}</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import title from "@/components/common/title.vue"
	import divider from "@/components/common/divider.vue"
	import cuCustom from '@/components/common/custom.vue'
	export default {
		components: {
			title,
			divider,
			cuCustom
		},
		data() {
			return {
				value: 0,
				range: [{
						value: 0,
						text: "分类"
					},
					{
						value: 1,
						text: "二两蟹二两蟹"
					},
					{
						value: 2,
						text: "一两蟹"
					},
				],
				scorllHeight: 500,
				shopList: [],
				addlist: [],
				loadtext: "上拉加载更多",
				allChecked: false,
				formData: {
					name: "",
					idCard: null,
					bankUserName: "",
					bankCard: null,
					bankCity: "",
					bankName: "",
					startDate: "",
					endDate: ""
				},
				getApp:""
			}
		},
		onLoad() {
			uni.getSystemInfo({
				success: (res => {
					this.scorllHeight = res.windowHeight - uni.upx2px(600)
				})
			})
			this.getApp = getApp()
		},
		methods: {
			onKeyInput(e) {
				console.log(e.detail.value)
			},
			change(e) {
				console.log("e:", e);
			},
			// 上拉加载更多
			loadMore() {
				if (this.loadtext !== '上拉加载更多') return
				this.loadtext = "加载中..."
				setTimeout(() => {
					this.shopList = [...this.shopList, ...this.addlist]
					// 回复状态
					this.loadtext = "上拉加载更多"
				}, 2000)

			},
			toDetail() {
				uni.navigateTo({
					url: "./orderDetail"
				})
			},
			toDelete(index) {
				console.log(index)
			},
			showDrawer(e) {
				this.$refs[e].open()
			},
			// 关闭窗口
			closeDrawer(e) {
				this.$refs[e].close()
			},
			// 抽屉状态发生变化触发
			change(e, type) {
				console.log((type === 'showLeft' ? '左窗口' : '右窗口') + (e ? '打开' : '关闭'));
				this[type] = e
			}
		}
	}
</script>

<style scoped lang="scss">
	.balance {
		height: 270rpx;
		position: relative;

		image {
			position: absolute;
			z-index: -1;
		}
	}
</style>